/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hanuma;

import java.util.*;
import java.io.*;

/**
 *
 * @author niyaz
 */
public class BagOfWords {

    public Map<String, Integer> words = new HashMap<String,Integer>();

    public BagOfWords(String file) {
        BufferedReader r = null;
        try {
            r = new BufferedReader(new FileReader(new File(file)));
            String str = r.readLine();
            while (str != null) {
                String[] ar = str.split(":");
                words.put(ar[0].toLowerCase(), Integer.parseInt(ar[1]));
                str = r.readLine();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
